<?xml version='1.0' encoding='UTF-8' ?>
<!DOCTYPE composition PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<ui:composition xmlns:ui="http://java.sun.com/jsf/facelets"
                xmlns="http://www.w3.org/1999/xhtml"
                template="./../home.xhtml"
                xmlns:h="http://xmlns.jcp.org/jsf/html"
                xmlns:f="http://xmlns.jcp.org/jsf/core"
                xmlns:p="http://primefaces.org/ui">

    <ui:define name="content">
        <div class="col-lg-12">
            <h3 class="page-header" id="comercio">
                Administración de SubProductos
                <h:link value="Regresar a Listado" outcome="list.xhtml" styleClass="pull-right" style="font-size: 16px; margin-right: 30px;"/>
            </h3>
        </div>
        <div class="row">
            <div class="col-lg-12">
                <div class="panel panel-primary">
                    <h:messages id="msg" globalOnly="true" styleClass="list-group" infoClass="list-group-item list-group-item-success"
                                errorClass="list-group-item list-group-item-danger" />
                    <div class="panel-heading" style="font-weight: bold;" >Actualizar SubProducto</div>
                    <div class="panel-body">
                        <div class="row" id="modificarComercio">
                            <div class="col-lg-8 col-lg-offset-1">
                                <h:form id="frmRegistrarUser" styleClass="form-horizontal" >
                                    <f:event type="preRenderView" listener="#{subtipo.initUpdate}" />
                                    <div class="form-group has-feedback">
                                        <label for="prod" class="col-sm-3 control-label">Producto :</label>
                                        <div class="col-sm-5">
                                            <h:selectOneMenu id="prod" value="#{subtipo.subPM.producto.id}" styleClass="form-control" >
                                                <f:selectItem noSelectionOption="true" itemLabel="Seleccionar" itemValue="0" />
                                                <f:selectItems value="#{subtipo.lstProducto}" var="list" itemLabel="#{list.nombre}" itemValue="#{list.id}" />
                                            </h:selectOneMenu>
                                        </div>						
                                    </div>
                                    <div class="form-group has-feedback">
                                        <label for="marca" class="col-sm-3 control-label">Marca :</label>
                                        <div class="col-sm-5">
                                            <h:selectOneMenu id="marca" value="#{subtipo.subPM.marca.id}" styleClass="form-control" >
                                                <f:selectItem noSelectionOption="true" itemLabel="Seleccionar" itemValue="0" />
                                                <f:selectItems value="#{subtipo.lstMarca}" var="list" itemLabel="#{list.nombre}" itemValue="#{list.id}" />
                                            </h:selectOneMenu>
                                        </div>						
                                    </div>
                                    <div class="form-group has-feedback">
                                        <label for="codigo" class="col-sm-3 control-label">Codigo :</label>
                                        <div class="col-sm-5">
                                            <p:inputText styleClass="form-control" id="codigo" value="#{subtipo.subPM.codigo}" maxlength="20"/>
                                        </div>						    
                                    </div>
                                    <div class="form-group has-feedback">
                                        <label for="precio" class="col-sm-3 control-label">Precio :</label>
                                        <div class="col-sm-5">
                                            <p:inputText styleClass="form-control" id="precio" value="#{subtipo.precio_aux}" />
                                        </div>
                                    </div>
                                    <div class="form-group has-feedback">
                                        <label for="des" class="col-sm-3 control-label">Descripcion :</label>
                                        <div class="col-sm-5">
                                            <p:inputText styleClass="form-control" id="des" value="#{subtipo.subPM.descripcion}" maxlength="100"/>
                                        </div>
                                    </div>                                    
                                    <p:commandButton value="Guardar" styleClass="btn btn-primary" actionListener="#{subtipo.actualizar}" update="@form :msg" />
                                </h:form>
                            </div>
                        </div>
                    </div>
                </div>
            </div>
        </div>
    </ui:define>

</ui:composition>
